<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <title>Login Page</title>
    </h:head>
    <h:body>
        <h:form id="loginform">
            <p:panel header="Login Form">
                <p:panelGrid columns="2">
                    <p:outputLabel for="username" value="Email"/>
                    <p:inputText id="username" value="#{loginBean.username}" 
                                 required="true" />
                    <p:outputLabel for="pass" value="Password"/>
                    <p:password id="pass" value="#{loginBean.password}" 
                                required="true" />
                    <p:commandButton id="submit" action="#{loginBean.login()}" value="Login" ajax="true" update="@all"/>
                </p:panelGrid>
            </p:panel>
            <h:messages  style="color: red"/>
        </h:form>
        <p:link outcome="register" value="Register"/>
    </h:body>
</html>

